import Foundation

protocol MPConvertibleOptional {
    static func mp_subType() -> Any.Type
}

extension Optional : MPConvertibleOptional {
    
    static func mp_subType() -> Any.Type {
        var subType : Any.Type = Wrapped.self
        while subType is MPConvertibleOptional.Type {
            subType = (subType as! MPConvertibleOptional.Type).mp_subType()
        }
        return subType
    }
    
}
